
import axios from 'axios';

/**
 * 菜谱材料关系
 */
export class MenuMaterialRelationShipService {
    // 分页查询列表
    static findMenuMaterialRelationShips (queryParams) {
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/findMenuMaterialRelationShips',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的菜谱材料关系
    static findMenuMaterialRelationShip (menuMaterialRelationShipId) {
        const query = {
            menuMaterialRelationShipId
        }
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/findMenuMaterialRelationShip',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的菜谱材料关系(包含外键名称)
    static findMenuMaterialRelationShipForView (menuMaterialRelationShipId) {
        const query = {
            menuMaterialRelationShipId
        }
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/findMenuMaterialRelationShipForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的菜谱材料关系(包含外键名称)
    static findMenuMaterialRelationShipForEdit (menuMaterialRelationShipId) {
        const query = {
            menuMaterialRelationShipId
        }
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/findMenuMaterialRelationShipForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的菜谱材料关系(只提取ID 和 Name)
    static findMenuMaterialRelationShipsWithIdNameById (menuMaterialRelationShipId) {
        const query = {
            menuMaterialRelationShipId
        }
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/findMenuMaterialRelationShipsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询菜谱材料关系集合(只提取ID 和 Name)
    static findMenuMaterialRelationShipsWithIdNameByName (menuMaterialRelationShipName) {
        const query = {
            menuMaterialRelationShipName
        }
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/findMenuMaterialRelationShipsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存菜谱材料关系
    static saveMenuMaterialRelationShip (menuMaterialRelationShip) {
        const query = {}
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/saveMenuMaterialRelationShip',
            method: 'POST',
            params: query,
            data: menuMaterialRelationShip
        });
    }

    //修改保存菜谱材料关系
    static updateMenuMaterialRelationShip (menuMaterialRelationShip) {
        const query = {}
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/updateMenuMaterialRelationShip',
            method: 'POST',
            params: query,
            data: menuMaterialRelationShip
        });
    }

    //根据ID查询指定的菜谱材料关系(只提取ID 和 Name)
    static deleteMenuMaterialRelationShip (menuMaterialRelationShipId) {
        const query = {
            menuMaterialRelationShipId
        }
        return axios({
            url: '/restaurant/sale/MenuMaterialRelationShip/deleteMenuMaterialRelationShip',
            method: 'POST',
            params: query,
        });
    }

  static batchHandle(insertRecords, removeRecords, updateRecords) {
    const data={insertRecords,removeRecords,updateRecords}
    return axios({
      url: '/restaurant/sale/MenuMaterialRelationShip/batchHandle',
      method: 'POST',
      data: data,
    });
  }
}
